<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import = "com.project.control.*"%>
<%@ page import = "com.project.model.Food"%>
<%@ page import = "com.project.control.FoodControl"%>
<html>
	<head>
		<title>删除动态</title>
	</head>
	<body>
		<%
			request.setCharacterEncoding("UTF-8");
			String href = "food.jsp";
			int id = Integer.parseInt(request.getParameter("id"));
			System.out.println(id);
			FoodControl hc = new FoodControl();
			if (hc.deleteFood(id)) {
		%>
		<script language="javascript">
		alert("删除成功");
		window.location.href = "<%="food.jsp"%>";
		</script>
		<%
			} else {
		%>
		<script language="javascript">
		alert("删除失败");
		window.location.href = "<%="food.jsp"%>";
		</script>
		<%
			}
		%>
	</body>
</html>
